package com.tfswx.fljdmxyy.query.rzgl;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 操作日志查询参数
 *
 * @Author 陈文佳
 * @Date 2023/03/24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CzrzQueryParam implements Serializable {

    @ApiModelProperty(name = "rzfl", value = "日志分类")
    private List<String> rzfl;

    @ApiModelProperty(name = "czlx", value = "操作类型")
    private List<String> czlx;

    @ApiModelProperty(name = "czrdwbm", value = "操作人单位编码")
    private List<String> czrdwbm;

    @ApiModelProperty(name = "czkssj", value = "操作开始时间")
    private Date czKssj;

    @ApiModelProperty(name = "czjssj", value = "操作结束时间")
    private Date czJssj;

    @ApiModelProperty(name = "gjz", value = "关键字")
    private String gjz;

    @ApiModelProperty(name = "czjg", value = "操作结果")
    private String czjg;

    public void setCzKssj(Date czKssj) {
        if (ObjectUtil.isNotEmpty(czKssj)) {
            this.czKssj = DateUtil.beginOfDay(czKssj);
        }
    }

    public void setCzJssj(Date czJssj) {
        if (ObjectUtil.isNotEmpty(czJssj)) {
            this.czJssj = DateUtil.beginOfDay(DateUtil.offsetDay(czJssj, 1));
        }
    }

}